import Vue from 'vue'
import VueRouter from 'vue-router'
import Uploader from '../views/Uploader.vue'
import Index from '../views/Index.vue'
import Sort from '../views/Sort.vue'
import Me from '../views/Me'
import Attention from '../views/Attention'
import Login from '../views/Login'
import Cookbook from '../views/Cookbook'
import Register from '../views/Register'
import Collection from '../views/Collection'

import Navbar from '../components/Navbar' //测试
import Tabbar from '../components/Tabbar'


Vue.use(VueRouter)
const routes = [
  {
    path: '/collection',
    name: 'Collection',
    component: Collection,
  },
  {
    path: '/tabbar',
    name: 'Tabbar',
    component: Tabbar,
  },
  {
    path: '/cookbook',
    name: 'Cookbook',
    component: Cookbook,
  },
  {
    path: '/login',
    name: 'Login',
    component: Login,
  },
  {
    path: '/attention',
    name: 'Attention',
    component: Attention,
  },
  {
    path: '/me',
    name: 'Me',
    component: Me,
  },
  {
    path: '/',
    name: 'Index',
    component: Index,
  },
  {
    path: '/sort',
    name: 'Sort',
    component: Sort,
  },
  {
    path: '/uploader',
    name: 'Uploader',
    component: Uploader,
  },
  {
    path: '/navbar',
    name: 'Navbar',
    component: Navbar
  },
  {
    path: '/register',
    name: 'Register',
    component: Register
  },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router

